package proxy

import (
	proxy2 "cloud_android_backend/pkg/models/proxy"
	"cloud_android_backend/pkg/models/resources"
	"cloud_android_backend/pkg/modules/realphone"
	"context"
	"encoding/json"
	"fmt"
	"github.com/jinzhu/gorm"
	"github.com/speps/go-hashids/v2"
	"golang.org/x/net/proxy"
	"io"
	"modules.tenxcloud.com/common/composite"
	"net"
	"net/http"
	"net/url"
	"time"
)

const HashIdsSalt = "jintiantech666"

type CreateProxyRequest struct {
	Name     string `json:"name"`
	Protocol string `json:"protocol"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	Remark   string `json:"remark"`
}
type ProxyWithUserHashId struct {
	*proxy2.Proxy
	HashId           string                   `json:"hash_id"`
	BindNum          int                      `json:"bind_num"`
	BindInstanceList []resources.InstanceUses `json:"bind_instance_list"`
}

func CreateProxy(req CreateProxyRequest, userId string) (*ProxyWithUserHashId, error) {

	proxy1 := &proxy2.Proxy{
		ProxyName: req.Name,
		Protocol:  req.Protocol,
		Host:      req.Host,
		Port:      req.Port,
		UserName:  req.Username,
		Password:  req.Password,
		Type:      "static",
		Remark:    req.Remark,
	}
	proxyInfoRet := &ProxyWithUserHashId{
		Proxy: proxy1,
	}
	var (
		ipInfo IpifyResponse
		err    error
	)
	hostPort := req.Host + ":" + fmt.Sprintf("%d", req.Port)
	//获取IP所属国家
	if proxy1.Protocol == "http" || proxy1.Protocol == "https" {
		ipInfo, err = getOutboundIPViaHTTPProxy(req.Protocol+"://"+hostPort, req.Username, req.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return proxyInfoRet, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	} else if proxy1.Protocol == "socks5" {
		ipInfo, err = getOutboundIPViaSocks5(hostPort, req.Username, req.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return proxyInfoRet, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	}
	proxy1.ExternalIp = ipInfo.Query
	proxy1.Country = ipInfo.Country
	proxy1.RegionCode = ipInfo.Region
	proxy1.City = ipInfo.City
	proxy1.CountryCode = ipInfo.CountryCode
	proxy1.UserId = userId
	proxy1.Status = 1
	proxy1.Timezone = ipInfo.Timezone

	proxy1.Lat = fmt.Sprintf("%f", ipInfo.Lat)
	proxy1.Lon = fmt.Sprintf("%f", ipInfo.Lon)

	db, err := composite.Database.GetOrm()
	if err != nil {
		return proxyInfoRet, err
	}
	err = proxy1.Create(db)
	if err != nil {
		fmt.Println("Error:", err)
		return proxyInfoRet, err
	}
	hd := hashids.NewData()
	hd.Salt = HashIdsSalt // 盐值决定编码结果
	hd.MinLength = 8      // 最短长度
	h, err := hashids.NewWithData(hd)
	if err != nil {
		fmt.Println(err)
	}
	// 编码
	encoded, err := h.EncodeInt64([]int64{int64(proxy1.Id)})
	if err != nil {
		fmt.Println(err)
	}
	proxyInfoRet.HashId = encoded
	return proxyInfoRet, nil

}

type IpifyResponse struct {
	Status      string  `json:"status"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Timezone    string  `json:"timezone"`
	Isp         string  `json:"isp"`
	Org         string  `json:"org"`
	As          string  `json:"as"`
	Query       string  `json:"query"`
}

func getOutboundIPViaHTTPProxy(proxyURL, username, password, targetURL string) (IpifyResponse, error) {
	var r IpifyResponse
	u, err := url.Parse(proxyURL)
	if err != nil {
		return r, fmt.Errorf("invalid proxy URL: %w", err)
	}
	// 如果 proxyUser/proxyPass 非空，则将其设置到 URL 的 User 部分
	if username != "" || password != "" {
		u.User = url.UserPassword(username, password)
	}

	transport := &http.Transport{
		Proxy: http.ProxyURL(u),
		// optionally: set TLSClientConfig, etc.
	}
	client := &http.Client{
		Transport: transport,
		Timeout:   10 * time.Second,
	}
	resp, err := client.Get(targetURL)
	if err != nil {
		return r, fmt.Errorf("request failed: %w", err)
	}
	defer resp.Body.Close()
	body, err := io.ReadAll(resp.Body)
	if err != nil {
		return r, fmt.Errorf("read body failed: %w", err)
	}
	//var r IpifyResponse
	if err := json.Unmarshal(body, &r); err != nil {
		// maybe target returns plain text instead of json
		return r, err
	}
	return r, nil
}

func getOutboundIPViaSocks5(proxyHostPort, username, password, targetURL string) (IpifyResponse, error) {
	var r IpifyResponse
	auth := &proxy.Auth{
		User:     username,
		Password: password,
	}
	dialer, err := proxy.SOCKS5("tcp", proxyHostPort, auth, proxy.Direct)
	if err != nil {
		return r, fmt.Errorf("create socks5 dialer failed: %w", err)
	}
	// Create a Transport that uses this dialer
	transport := &http.Transport{
		DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
			return dialer.Dial(network, addr)
		},
		// optionally: TLSHandshakeTimeout, etc.
	}
	client := &http.Client{
		Transport: transport,
		Timeout:   10 * time.Second,
	}
	resp, err := client.Get(targetURL)
	if err != nil {
		return r, fmt.Errorf("request via socks5 failed: %w", err)
	}
	defer resp.Body.Close()
	body, err := io.ReadAll(resp.Body)
	if err != nil {
		return r, fmt.Errorf("read body failed: %w", err)
	}

	if err := json.Unmarshal(body, &r); err != nil {
		return r, err
	}
	return r, nil
}

func DetectIP(param CreateProxyRequest) (IpifyResponse, error) {
	var (
		ipInfo IpifyResponse
		err    error
	)
	hostport := param.Host + ":" + fmt.Sprintf("%d", param.Port)
	//获取IP所属国家
	if param.Protocol == "http" || param.Protocol == "https" {
		ipInfo, err = getOutboundIPViaHTTPProxy(param.Protocol+"://"+hostport, param.Username, param.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return ipInfo, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	} else if param.Protocol == "socks5" {
		ipInfo, err = getOutboundIPViaSocks5(hostport, param.Username, param.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return ipInfo, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	}
	return ipInfo, nil
}

func ClashSubscribe(hashId string) (string, error) {
	hd := hashids.NewData()
	hd.Salt = HashIdsSalt // 盐值决定编码结果
	hd.MinLength = 8      // 最短长度
	h, err := hashids.NewWithData(hd)
	if err != nil {
		fmt.Println(err)
		return "", fmt.Errorf("hashids init failed")
	}

	// 解码
	decoded, err := h.DecodeInt64WithError(hashId)
	if err != nil {
		fmt.Println(err)
		return "", fmt.Errorf("hashids decode failed")
	}
	if len(decoded) < 1 {
		return "", fmt.Errorf("hashids decode failed, list is empty")
	}
	fmt.Println("Decoded ID slice:", decoded)
	db, err := composite.Database.GetOrm()
	proxy1 := proxy2.Proxy{
		Id: int(decoded[0]),
	}
	err = proxy1.GetById(db)
	if err != nil {
		return "", err
	}
	fmt.Println("proxy1-re", proxy1)
	res := fmt.Sprintf(`#!MANAGED-CONFIG https://clp.jtcloud.icu/api/v1/proxy/clash_subscribe

port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: false
mode: rule
log-level: silent
external-controller: '0.0.0.0:9090'
secret: ''
dns:
  enable: true
  listen: '0.0.0.0:1053'
  ipv6: false
  default-nameserver:
    - 119.29.29.29
    - 223.5.5.5
    - 114.114.114.114
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  use-hosts: true
  nameserver:
    - 'https://1.12.12.12/dns-query'
    - 'https://223.5.5.5/dns-query'
    - 'https://doh.360.cn/dns-query'
  fallback:
    - 'tls://1.12.12.12:853'
    - 'tls://223.5.5.5:853'
    - 'https://cloudflare-dns.com/dns-query'
    - 'https://dns.google/dns-query'
  fallback-filter:
    geoip: true
    ipcidr:
      - 240.0.0.0/4
      - 0.0.0.0/32
proxies:
  -
    name: local
    type: %s
    server: %s
    port: %d
    username: %s
    password: %s
  
proxy-groups:
  -
    name: 🔰国外流量
    type: select
    proxies:
      - local
      - 🚀直接连接
  -
    name: ⚓️其他流量
    type: select
    proxies:
      - 🔰国外流量
      - 🚀直接连接
  -
    name: 🚀直接连接
    type: select
    proxies:
      - DIRECT


rules:

  - DOMAIN-SUFFIX,smtp,DIRECT
  - DOMAIN-KEYWORD,aria2,DIRECT

  - DOMAIN-SUFFIX,ampproject.org,🔰国外流量
  - DOMAIN-SUFFIX,appspot.com,🔰国外流量
  - DOMAIN-SUFFIX,blogger.com,🔰国外流量
  - DOMAIN-SUFFIX,getoutline.org,🔰国外流量
  - DOMAIN-SUFFIX,gvt0.com,🔰国外流量
  - DOMAIN-SUFFIX,gvt1.com,🔰国外流量
  - DOMAIN-SUFFIX,gvt3.com,🔰国外流量
  - DOMAIN-SUFFIX,xn--ngstr-lra8j.com,🔰国外流量
  - DOMAIN-KEYWORD,google,🔰国外流量
  - DOMAIN-KEYWORD,blogspot,🔰国外流量
  - DOMAIN-SUFFIX,onedrive.live.com,🔰国外流量
  - DOMAIN-SUFFIX,xboxlive.com,🔰国外流量
  - DOMAIN-SUFFIX,cdninstagram.com,🔰国外流量
  - DOMAIN-SUFFIX,fb.com,🔰国外流量
  - DOMAIN-SUFFIX,fb.me,🔰国外流量
  - DOMAIN-SUFFIX,fbaddins.com,🔰国外流量
  - DOMAIN-SUFFIX,fbcdn.net,🔰国外流量
  - DOMAIN-SUFFIX,fbsbx.com,🔰国外流量
  - DOMAIN-SUFFIX,fbworkmail.com,🔰国外流量
  - DOMAIN-SUFFIX,instagram.com,🔰国外流量
  - DOMAIN-SUFFIX,m.me,🔰国外流量
  - DOMAIN-SUFFIX,messenger.com,🔰国外流量
  - DOMAIN-SUFFIX,oculus.com,🔰国外流量
  - DOMAIN-SUFFIX,oculuscdn.com,🔰国外流量
  - DOMAIN-SUFFIX,rocksdb.org,🔰国外流量
  - DOMAIN-SUFFIX,whatsapp.biz,🔰国外流量
  - DOMAIN-SUFFIX,whatsapp.com,🔰国外流量
  - DOMAIN-SUFFIX,whatsapp.net,🔰国外流量
  - DOMAIN-KEYWORD,whatsapp,🔰国外流量
  - DOMAIN-KEYWORD,facebook,🔰国外流量
  - IP-CIDR,158.85.224.160/27,🔰国外流量,no-resolve
  - IP-CIDR,158.85.46.128/27,🔰国外流量,no-resolve
  - IP-CIDR,158.85.5.192/27,🔰国外流量,no-resolve
  - IP-CIDR,173.192.222.160/27,🔰国外流量,no-resolve
  - IP-CIDR,173.192.231.32/27,🔰国外流量,no-resolve
  - IP-CIDR,18.194.0.0/15,🔰国外流量,no-resolve
  - IP-CIDR,184.173.128.0/17,🔰国外流量,no-resolve
  - IP-CIDR,208.43.122.128/27,🔰国外流量,no-resolve
  - IP-CIDR,34.224.0.0/12,🔰国外流量,no-resolve
  - IP-CIDR,50.22.198.204/30,🔰国外流量,no-resolve
  - IP-CIDR,54.242.0.0/15,🔰国外流量,no-resolve
  - IP-CIDR,3.123.36.126/32,🔰国外流量,no-resolve
  - IP-CIDR,35.157.215.84/32,🔰国外流量,no-resolve
  - IP-CIDR,35.157.217.255/32,🔰国外流量,no-resolve
  - IP-CIDR,52.58.209.134/32,🔰国外流量,no-resolve
  - IP-CIDR,54.93.124.31/32,🔰国外流量,no-resolve
  - IP-CIDR,54.162.243.80/32,🔰国外流量,no-resolve
  - IP-CIDR,54.173.34.141/32,🔰国外流量,no-resolve
  - IP-CIDR,54.235.23.242/32,🔰国外流量,no-resolve
  - IP-CIDR,169.45.248.118/32,🔰国外流量,no-resolve
  - DOMAIN-SUFFIX,pscp.tv,🔰国外流量
  - DOMAIN-SUFFIX,periscope.tv,🔰国外流量
  - DOMAIN-SUFFIX,t.co,🔰国外流量
  - DOMAIN-SUFFIX,twimg.co,🔰国外流量
  - DOMAIN-SUFFIX,twimg.com,🔰国外流量
  - DOMAIN-SUFFIX,twitpic.com,🔰国外流量
  - DOMAIN-SUFFIX,vine.co,🔰国外流量
  - DOMAIN-KEYWORD,twitter,🔰国外流量
  - DOMAIN-SUFFIX,t.me,🔰国外流量
  - DOMAIN-SUFFIX,tdesktop.com,🔰国外流量
  - DOMAIN-SUFFIX,telegra.ph,🔰国外流量
  - DOMAIN-SUFFIX,telegram.me,🔰国外流量
  - DOMAIN-SUFFIX,telegram.org,🔰国外流量
  - IP-CIDR,91.108.4.0/22,🔰国外流量,no-resolve
  - IP-CIDR,91.108.8.0/22,🔰国外流量,no-resolve
  - IP-CIDR,91.108.12.0/22,🔰国外流量,no-resolve
  - IP-CIDR,91.108.16.0/22,🔰国外流量,no-resolve
  - IP-CIDR,91.108.56.0/22,🔰国外流量,no-resolve
  - IP-CIDR,149.154.160.0/20,🔰国外流量,no-resolve
  - IP-CIDR6,2001:b28:f23d::/48,🔰国外流量,no-resolve
  - IP-CIDR6,2001:b28:f23f::/48,🔰国外流量,no-resolve
  - IP-CIDR6,2001:67c:4e8::/48,🔰国外流量,no-resolve
  - DOMAIN-SUFFIX,line.me,🔰国外流量
  - DOMAIN-SUFFIX,line-apps.com,🔰国外流量
  - DOMAIN-SUFFIX,line-scdn.net,🔰国外流量
  - DOMAIN-SUFFIX,naver.jp,🔰国外流量
  - IP-CIDR,103.2.30.0/23,🔰国外流量,no-resolve
  - IP-CIDR,125.209.208.0/20,🔰国外流量,no-resolve
  - IP-CIDR,147.92.128.0/17,🔰国外流量,no-resolve
  - IP-CIDR,203.104.144.0/21,🔰国外流量,no-resolve
  - DOMAIN-SUFFIX,4shared.com,🔰国外流量
  - DOMAIN-SUFFIX,520cc.cc,🔰国外流量
  - DOMAIN-SUFFIX,881903.com,🔰国外流量
  - DOMAIN-SUFFIX,9cache.com,🔰国外流量
  - DOMAIN-SUFFIX,9gag.com,🔰国外流量
  - DOMAIN-SUFFIX,abc.com,🔰国外流量
  - DOMAIN-SUFFIX,abc.net.au,🔰国外流量
  - DOMAIN-SUFFIX,abebooks.com,🔰国外流量
  - DOMAIN-SUFFIX,amazon.co.jp,🔰国外流量
  - DOMAIN-SUFFIX,apigee.com,🔰国外流量
  - DOMAIN-SUFFIX,apk-dl.com,🔰国外流量
  - DOMAIN-SUFFIX,apkfind.com,🔰国外流量
  - DOMAIN-SUFFIX,apkmirror.com,🔰国外流量
  - DOMAIN-SUFFIX,apkmonk.com,🔰国外流量
  - DOMAIN-SUFFIX,apkpure.com,🔰国外流量
  - DOMAIN-SUFFIX,aptoide.com,🔰国外流量
  - DOMAIN-SUFFIX,archive.is,🔰国外流量
  - DOMAIN-SUFFIX,archive.org,🔰国外流量
  - DOMAIN-SUFFIX,arte.tv,🔰国外流量
  - DOMAIN-SUFFIX,artstation.com,🔰国外流量
  - DOMAIN-SUFFIX,arukas.io,🔰国外流量
  - DOMAIN-SUFFIX,ask.com,🔰国外流量
  - DOMAIN-SUFFIX,avg.com,🔰国外流量
  - DOMAIN-SUFFIX,avgle.com,🔰国外流量
  - DOMAIN-SUFFIX,badoo.com,🔰国外流量
  - DOMAIN-SUFFIX,bandwagonhost.com,🔰国外流量
  - DOMAIN-SUFFIX,bbc.com,🔰国外流量
  - DOMAIN-SUFFIX,behance.net,🔰国外流量
  - DOMAIN-SUFFIX,bibox.com,🔰国外流量
  - DOMAIN-SUFFIX,biggo.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,binance.com,🔰国外流量
  - DOMAIN-SUFFIX,bitcointalk.org,🔰国外流量
  - DOMAIN-SUFFIX,bitfinex.com,🔰国外流量
  - DOMAIN-SUFFIX,bitmex.com,🔰国外流量
  - DOMAIN-SUFFIX,bit-z.com,🔰国外流量
  - DOMAIN-SUFFIX,bloglovin.com,🔰国外流量
  - DOMAIN-SUFFIX,bloomberg.cn,🔰国外流量
  - DOMAIN-SUFFIX,bloomberg.com,🔰国外流量
  - DOMAIN-SUFFIX,blubrry.com,🔰国外流量
  - DOMAIN-SUFFIX,book.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,booklive.jp,🔰国外流量
  - DOMAIN-SUFFIX,books.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,boslife.net,🔰国外流量
  - DOMAIN-SUFFIX,box.com,🔰国外流量
  - DOMAIN-SUFFIX,businessinsider.com,🔰国外流量
  - DOMAIN-SUFFIX,bwh1.net,🔰国外流量
  - DOMAIN-SUFFIX,castbox.fm,🔰国外流量
  - DOMAIN-SUFFIX,cbc.ca,🔰国外流量
  - DOMAIN-SUFFIX,cdw.com,🔰国外流量
  - DOMAIN-SUFFIX,change.org,🔰国外流量
  - DOMAIN-SUFFIX,channelnewsasia.com,🔰国外流量
  - DOMAIN-SUFFIX,ck101.com,🔰国外流量
  - DOMAIN-SUFFIX,clarionproject.org,🔰国外流量
  - DOMAIN-SUFFIX,clyp.it,🔰国外流量
  - DOMAIN-SUFFIX,cna.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,comparitech.com,🔰国外流量
  - DOMAIN-SUFFIX,conoha.jp,🔰国外流量
  - DOMAIN-SUFFIX,crucial.com,🔰国外流量
  - DOMAIN-SUFFIX,cts.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,cw.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,cyberctm.com,🔰国外流量
  - DOMAIN-SUFFIX,dailymotion.com,🔰国外流量
  - DOMAIN-SUFFIX,dailyview.tw,🔰国外流量
  - DOMAIN-SUFFIX,daum.net,🔰国外流量
  - DOMAIN-SUFFIX,daumcdn.net,🔰国外流量
  - DOMAIN-SUFFIX,dcard.tw,🔰国外流量
  - DOMAIN-SUFFIX,deepdiscount.com,🔰国外流量
  - DOMAIN-SUFFIX,depositphotos.com,🔰国外流量
  - DOMAIN-SUFFIX,deviantart.com,🔰国外流量
  - DOMAIN-SUFFIX,disconnect.me,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.com,🔰国外流量
  - DOMAIN-SUFFIX,airhorn.solutions,🔰国外流量
  - DOMAIN-SUFFIX,airhornbot.com,🔰国外流量
  - DOMAIN-SUFFIX,bigbeans.solutions,🔰国外流量
  - DOMAIN-SUFFIX,dis.gd,🔰国外流量
  - DOMAIN-SUFFIX,discord-activities.com,🔰国外流量
  - DOMAIN-SUFFIX,discord-attachments-uploads-prd.storage.googleapis.com,🔰国外流量
  - DOMAIN-SUFFIX,discord.co,🔰国外流量
  - DOMAIN-SUFFIX,discord.com,🔰国外流量
  - DOMAIN-SUFFIX,discord.design,🔰国外流量
  - DOMAIN-SUFFIX,discord.dev,🔰国外流量
  - DOMAIN-SUFFIX,discord.gg,🔰国外流量
  - DOMAIN-SUFFIX,discord.gift,🔰国外流量
  - DOMAIN-SUFFIX,discord.gifts,🔰国外流量
  - DOMAIN-SUFFIX,discord.media,🔰国外流量
  - DOMAIN-SUFFIX,discord.new,🔰国外流量
  - DOMAIN-SUFFIX,discord.store,🔰国外流量
  - DOMAIN-SUFFIX,discord.tools,🔰国外流量
  - DOMAIN-SUFFIX,discordactivities.com,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.com,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.io,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.net,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.page.link,🔰国外流量
  - DOMAIN-SUFFIX,discordcdn.com,🔰国外流量
  - DOMAIN-SUFFIX,discordmerch.com,🔰国外流量
  - DOMAIN-SUFFIX,discordpartygames.com,🔰国外流量
  - DOMAIN-SUFFIX,discordsays.com,🔰国外流量
  - DOMAIN-SUFFIX,discordstatus.com,🔰国外流量
  - DOMAIN-SUFFIX,hammerandchisel.ssl.zendesk.com,🔰国外流量
  - DOMAIN-SUFFIX,watchanimeattheoffice.com,🔰国外流量
  - DOMAIN-SUFFIX,discordapp.net,🔰国外流量
  - DOMAIN-SUFFIX,disqus.com,🔰国外流量
  - DOMAIN-SUFFIX,dlercloud.com,🔰国外流量
  - DOMAIN-SUFFIX,dns2go.com,🔰国外流量
  - DOMAIN-SUFFIX,dowjones.com,🔰国外流量
  - DOMAIN-SUFFIX,dropbox.com,🔰国外流量
  - DOMAIN-SUFFIX,dropboxusercontent.com,🔰国外流量
  - DOMAIN-SUFFIX,duckduckgo.com,🔰国外流量
  - DOMAIN-SUFFIX,dw.com,🔰国外流量
  - DOMAIN-SUFFIX,dynu.com,🔰国外流量
  - DOMAIN-SUFFIX,earthcam.com,🔰国外流量
  - DOMAIN-SUFFIX,ebookservice.tw,🔰国外流量
  - DOMAIN-SUFFIX,economist.com,🔰国外流量
  - DOMAIN-SUFFIX,edgecastcdn.net,🔰国外流量
  - DOMAIN-SUFFIX,edu,🔰国外流量
  - DOMAIN-SUFFIX,elpais.com,🔰国外流量
  - DOMAIN-SUFFIX,enanyang.my,🔰国外流量
  - DOMAIN-SUFFIX,encyclopedia.com,🔰国外流量
  - DOMAIN-SUFFIX,esoir.be,🔰国外流量
  - DOMAIN-SUFFIX,etherscan.io,🔰国外流量
  - DOMAIN-SUFFIX,euronews.com,🔰国外流量
  - DOMAIN-SUFFIX,evozi.com,🔰国外流量
  - DOMAIN-SUFFIX,feedly.com,🔰国外流量
  - DOMAIN-SUFFIX,firech.at,🔰国外流量
  - DOMAIN-SUFFIX,flickr.com,🔰国外流量
  - DOMAIN-SUFFIX,flitto.com,🔰国外流量
  - DOMAIN-SUFFIX,foreignpolicy.com,🔰国外流量
  - DOMAIN-SUFFIX,freebrowser.org,🔰国外流量
  - DOMAIN-SUFFIX,freewechat.com,🔰国外流量
  - DOMAIN-SUFFIX,freeweibo.com,🔰国外流量
  - DOMAIN-SUFFIX,friday.tw,🔰国外流量
  - DOMAIN-SUFFIX,ftchinese.com,🔰国外流量
  - DOMAIN-SUFFIX,ftimg.net,🔰国外流量
  - DOMAIN-SUFFIX,gate.io,🔰国外流量
  - DOMAIN-SUFFIX,getlantern.org,🔰国外流量
  - DOMAIN-SUFFIX,getsync.com,🔰国外流量
  - DOMAIN-SUFFIX,globalvoices.org,🔰国外流量
  - DOMAIN-SUFFIX,goo.ne.jp,🔰国外流量
  - DOMAIN-SUFFIX,goodreads.com,🔰国外流量
  - DOMAIN-SUFFIX,gov,🔰国外流量
  - DOMAIN-SUFFIX,gov.tw,🔰国外流量
  - DOMAIN-SUFFIX,greatfire.org,🔰国外流量
  - DOMAIN-SUFFIX,gumroad.com,🔰国外流量
  - DOMAIN-SUFFIX,hbg.com,🔰国外流量
  - DOMAIN-SUFFIX,heroku.com,🔰国外流量
  - DOMAIN-SUFFIX,hightail.com,🔰国外流量
  - DOMAIN-SUFFIX,hk01.com,🔰国外流量
  - DOMAIN-SUFFIX,hkbf.org,🔰国外流量
  - DOMAIN-SUFFIX,hkbookcity.com,🔰国外流量
  - DOMAIN-SUFFIX,hkej.com,🔰国外流量
  - DOMAIN-SUFFIX,hket.com,🔰国外流量
  - DOMAIN-SUFFIX,hkgolden.com,🔰国外流量
  - DOMAIN-SUFFIX,hootsuite.com,🔰国外流量
  - DOMAIN-SUFFIX,hudson.org,🔰国外流量
  - DOMAIN-SUFFIX,hyread.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,ibtimes.com,🔰国外流量
  - DOMAIN-SUFFIX,i-cable.com,🔰国外流量
  - DOMAIN-SUFFIX,icij.org,🔰国外流量
  - DOMAIN-SUFFIX,icoco.com,🔰国外流量
  - DOMAIN-SUFFIX,imgur.com,🔰国外流量
  - DOMAIN-SUFFIX,initiummall.com,🔰国外流量
  - DOMAIN-SUFFIX,insecam.org,🔰国外流量
  - DOMAIN-SUFFIX,ipfs.io,🔰国外流量
  - DOMAIN-SUFFIX,issuu.com,🔰国外流量
  - DOMAIN-SUFFIX,istockphoto.com,🔰国外流量
  - DOMAIN-SUFFIX,japantimes.co.jp,🔰国外流量
  - DOMAIN-SUFFIX,jiji.com,🔰国外流量
  - DOMAIN-SUFFIX,jinx.com,🔰国外流量
  - DOMAIN-SUFFIX,jkforum.net,🔰国外流量
  - DOMAIN-SUFFIX,joinmastodon.org,🔰国外流量
  - DOMAIN-SUFFIX,justmysocks.net,🔰国外流量
  - DOMAIN-SUFFIX,justpaste.it,🔰国外流量
  - DOMAIN-SUFFIX,kakao.com,🔰国外流量
  - DOMAIN-SUFFIX,kakaocorp.com,🔰国外流量
  - DOMAIN-SUFFIX,kik.com,🔰国外流量
  - DOMAIN-SUFFIX,kobo.com,🔰国外流量
  - DOMAIN-SUFFIX,kobobooks.com,🔰国外流量
  - DOMAIN-SUFFIX,kodingen.com,🔰国外流量
  - DOMAIN-SUFFIX,licdn.com,🔰国外流量
  - DOMAIN-SUFFIX,linkedin.com,🔰国外流量
  - DOMAIN-SUFFIX,lemonde.fr,🔰国外流量
  - DOMAIN-SUFFIX,lepoint.fr,🔰国外流量
  - DOMAIN-SUFFIX,lihkg.com,🔰国外流量
  - DOMAIN-SUFFIX,listennotes.com,🔰国外流量
  - DOMAIN-SUFFIX,livestream.com,🔰国外流量
  - DOMAIN-SUFFIX,logmein.com,🔰国外流量
  - DOMAIN-SUFFIX,mail.ru,🔰国外流量
  - DOMAIN-SUFFIX,mailchimp.com,🔰国外流量
  - DOMAIN-SUFFIX,marc.info,🔰国外流量
  - DOMAIN-SUFFIX,matters.news,🔰国外流量
  - DOMAIN-SUFFIX,maying.co,🔰国外流量
  - DOMAIN-SUFFIX,medium.com,🔰国外流量
  - DOMAIN-SUFFIX,mega.nz,🔰国外流量
  - DOMAIN-SUFFIX,mil,🔰国外流量
  - DOMAIN-SUFFIX,mingpao.com,🔰国外流量
  - DOMAIN-SUFFIX,mobile01.com,🔰国外流量
  - DOMAIN-SUFFIX,myspace.com,🔰国外流量
  - DOMAIN-SUFFIX,myspacecdn.com,🔰国外流量
  - DOMAIN-SUFFIX,nanyang.com,🔰国外流量
  - DOMAIN-SUFFIX,naver.com,🔰国外流量
  - DOMAIN-SUFFIX,neowin.net,🔰国外流量
  - DOMAIN-SUFFIX,newstapa.org,🔰国外流量
  - DOMAIN-SUFFIX,nexitally.com,🔰国外流量
  - DOMAIN-SUFFIX,nhk.or.jp,🔰国外流量
  - DOMAIN-SUFFIX,nicovideo.jp,🔰国外流量
  - DOMAIN-SUFFIX,nii.ac.jp,🔰国外流量
  - DOMAIN-SUFFIX,nikkei.com,🔰国外流量
  - DOMAIN-SUFFIX,nofile.io,🔰国外流量
  - DOMAIN-SUFFIX,now.com,🔰国外流量
  - DOMAIN-SUFFIX,nrk.no,🔰国外流量
  - DOMAIN-SUFFIX,nyt.com,🔰国外流量
  - DOMAIN-SUFFIX,nytchina.com,🔰国外流量
  - DOMAIN-SUFFIX,nytcn.me,🔰国外流量
  - DOMAIN-SUFFIX,nytco.com,🔰国外流量
  - DOMAIN-SUFFIX,nytimes.com,🔰国外流量
  - DOMAIN-SUFFIX,nytimg.com,🔰国外流量
  - DOMAIN-SUFFIX,nytlog.com,🔰国外流量
  - DOMAIN-SUFFIX,nytstyle.com,🔰国外流量
  - DOMAIN-SUFFIX,ok.ru,🔰国外流量
  - DOMAIN-SUFFIX,okex.com,🔰国外流量
  - DOMAIN-SUFFIX,on.cc,🔰国外流量
  - DOMAIN-SUFFIX,orientaldaily.com.my,🔰国外流量
  - DOMAIN-SUFFIX,overcast.fm,🔰国外流量
  - DOMAIN-SUFFIX,paltalk.com,🔰国外流量
  - DOMAIN-SUFFIX,pao-pao.net,🔰国外流量
  - DOMAIN-SUFFIX,parsevideo.com,🔰国外流量
  - DOMAIN-SUFFIX,pbxes.com,🔰国外流量
  - DOMAIN-SUFFIX,pcdvd.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,pchome.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,pcloud.com,🔰国外流量
  - DOMAIN-SUFFIX,picacomic.com,🔰国外流量
  - DOMAIN-SUFFIX,pinimg.com,🔰国外流量
  - DOMAIN-SUFFIX,pixiv.net,🔰国外流量
  - DOMAIN-SUFFIX,player.fm,🔰国外流量
  - DOMAIN-SUFFIX,plurk.com,🔰国外流量
  - DOMAIN-SUFFIX,po18.tw,🔰国外流量
  - DOMAIN-SUFFIX,potato.im,🔰国外流量
  - DOMAIN-SUFFIX,potatso.com,🔰国外流量
  - DOMAIN-SUFFIX,prism-break.org,🔰国外流量
  - DOMAIN-SUFFIX,proxifier.com,🔰国外流量
  - DOMAIN-SUFFIX,pt.im,🔰国外流量
  - DOMAIN-SUFFIX,pts.org.tw,🔰国外流量
  - DOMAIN-SUFFIX,pubu.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,pubu.tw,🔰国外流量
  - DOMAIN-SUFFIX,pureapk.com,🔰国外流量
  - DOMAIN-SUFFIX,quora.com,🔰国外流量
  - DOMAIN-SUFFIX,quoracdn.net,🔰国外流量
  - DOMAIN-SUFFIX,rakuten.co.jp,🔰国外流量
  - DOMAIN-SUFFIX,readingtimes.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,readmoo.com,🔰国外流量
  - DOMAIN-SUFFIX,redbubble.com,🔰国外流量
  - DOMAIN-SUFFIX,reddit.com,🔰国外流量
  - DOMAIN-SUFFIX,redditmedia.com,🔰国外流量
  - DOMAIN-SUFFIX,resilio.com,🔰国外流量
  - DOMAIN-SUFFIX,reuters.com,🔰国外流量
  - DOMAIN-SUFFIX,reutersmedia.net,🔰国外流量
  - DOMAIN-SUFFIX,rfi.fr,🔰国外流量
  - DOMAIN-SUFFIX,rixcloud.com,🔰国外流量
  - DOMAIN-SUFFIX,roadshow.hk,🔰国外流量
  - DOMAIN-SUFFIX,scmp.com,🔰国外流量
  - DOMAIN-SUFFIX,scribd.com,🔰国外流量
  - DOMAIN-SUFFIX,seatguru.com,🔰国外流量
  - DOMAIN-SUFFIX,shadowsocks.org,🔰国外流量
  - DOMAIN-SUFFIX,shopee.tw,🔰国外流量
  - DOMAIN-SUFFIX,slideshare.net,🔰国外流量
  - DOMAIN-SUFFIX,softfamous.com,🔰国外流量
  - DOMAIN-SUFFIX,soundcloud.com,🔰国外流量
  - DOMAIN-SUFFIX,ssrcloud.org,🔰国外流量
  - DOMAIN-SUFFIX,startpage.com,🔰国外流量
  - DOMAIN-SUFFIX,steamcommunity.com,🔰国外流量
  - DOMAIN-SUFFIX,steemit.com,🔰国外流量
  - DOMAIN-SUFFIX,steemitwallet.com,🔰国外流量
  - DOMAIN-SUFFIX,t66y.com,🔰国外流量
  - DOMAIN-SUFFIX,tapatalk.com,🔰国外流量
  - DOMAIN-SUFFIX,teco-hk.org,🔰国外流量
  - DOMAIN-SUFFIX,teco-mo.org,🔰国外流量
  - DOMAIN-SUFFIX,teddysun.com,🔰国外流量
  - DOMAIN-SUFFIX,textnow.me,🔰国外流量
  - DOMAIN-SUFFIX,theguardian.com,🔰国外流量
  - DOMAIN-SUFFIX,theinitium.com,🔰国外流量
  - DOMAIN-SUFFIX,thetvdb.com,🔰国外流量
  - DOMAIN-SUFFIX,tineye.com,🔰国外流量
  - DOMAIN-SUFFIX,torproject.org,🔰国外流量
  - DOMAIN-SUFFIX,tumblr.com,🔰国外流量
  - DOMAIN-SUFFIX,turbobit.net,🔰国外流量
  - DOMAIN-SUFFIX,tutanota.com,🔰国外流量
  - DOMAIN-SUFFIX,tvboxnow.com,🔰国外流量
  - DOMAIN-SUFFIX,udn.com,🔰国外流量
  - DOMAIN-SUFFIX,unseen.is,🔰国外流量
  - DOMAIN-SUFFIX,upmedia.mg,🔰国外流量
  - DOMAIN-SUFFIX,uptodown.com,🔰国外流量
  - DOMAIN-SUFFIX,urbandictionary.com,🔰国外流量
  - DOMAIN-SUFFIX,ustream.tv,🔰国外流量
  - DOMAIN-SUFFIX,uwants.com,🔰国外流量
  - DOMAIN-SUFFIX,v2ray.com,🔰国外流量
  - DOMAIN-SUFFIX,viber.com,🔰国外流量
  - DOMAIN-SUFFIX,videopress.com,🔰国外流量
  - DOMAIN-SUFFIX,vimeo.com,🔰国外流量
  - DOMAIN-SUFFIX,voachinese.com,🔰国外流量
  - DOMAIN-SUFFIX,voanews.com,🔰国外流量
  - DOMAIN-SUFFIX,voxer.com,🔰国外流量
  - DOMAIN-SUFFIX,vzw.com,🔰国外流量
  - DOMAIN-SUFFIX,w3schools.com,🔰国外流量
  - DOMAIN-SUFFIX,washingtonpost.com,🔰国外流量
  - DOMAIN-SUFFIX,wattpad.com,🔰国外流量
  - DOMAIN-SUFFIX,whoer.net,🔰国外流量
  - DOMAIN-SUFFIX,wikimapia.org,🔰国外流量
  - DOMAIN-SUFFIX,wikipedia.org,🔰国外流量
  - DOMAIN-SUFFIX,wikiquote.org,🔰国外流量
  - DOMAIN-SUFFIX,wikiwand.com,🔰国外流量
  - DOMAIN-SUFFIX,winudf.com,🔰国外流量
  - DOMAIN-SUFFIX,wire.com,🔰国外流量
  - DOMAIN-SUFFIX,wordpress.com,🔰国外流量
  - DOMAIN-SUFFIX,workflow.is,🔰国外流量
  - DOMAIN-SUFFIX,worldcat.org,🔰国外流量
  - DOMAIN-SUFFIX,wsj.com,🔰国外流量
  - DOMAIN-SUFFIX,wsj.net,🔰国外流量
  - DOMAIN-SUFFIX,xhamster.com,🔰国外流量
  - DOMAIN-SUFFIX,xn--90wwvt03e.com,🔰国外流量
  - DOMAIN-SUFFIX,xn--i2ru8q2qg.com,🔰国外流量
  - DOMAIN-SUFFIX,xnxx.com,🔰国外流量
  - DOMAIN-SUFFIX,xvideos.com,🔰国外流量
  - DOMAIN-SUFFIX,yahoo.com,🔰国外流量
  - DOMAIN-SUFFIX,yandex.ru,🔰国外流量
  - DOMAIN-SUFFIX,ycombinator.com,🔰国外流量
  - DOMAIN-SUFFIX,yesasia.com,🔰国外流量
  - DOMAIN-SUFFIX,yes-news.com,🔰国外流量
  - DOMAIN-SUFFIX,yomiuri.co.jp,🔰国外流量
  - DOMAIN-SUFFIX,you-get.org,🔰国外流量
  - DOMAIN-SUFFIX,zaobao.com,🔰国外流量
  - DOMAIN-SUFFIX,zb.com,🔰国外流量
  - DOMAIN-SUFFIX,zello.com,🔰国外流量
  - DOMAIN-SUFFIX,zeronet.io,🔰国外流量
  - DOMAIN-SUFFIX,zoom.us,🔰国外流量
  - DOMAIN-KEYWORD,github,🔰国外流量
  - DOMAIN-KEYWORD,jav,🔰国外流量
  - DOMAIN-KEYWORD,pinterest,🔰国外流量
  - DOMAIN-KEYWORD,porn,🔰国外流量
  - DOMAIN-KEYWORD,wikileaks,🔰国外流量
  - DOMAIN-SUFFIX,apartmentratings.com,🔰国外流量
  - DOMAIN-SUFFIX,apartments.com,🔰国外流量
  - DOMAIN-SUFFIX,bankmobilevibe.com,🔰国外流量
  - DOMAIN-SUFFIX,bing.com,🔰国外流量
  - DOMAIN-SUFFIX,booktopia.com.au,🔰国外流量
  - DOMAIN-SUFFIX,cccat.io,🔰国外流量
  - DOMAIN-SUFFIX,centauro.com.br,🔰国外流量
  - DOMAIN-SUFFIX,clearsurance.com,🔰国外流量
  - DOMAIN-SUFFIX,costco.com,🔰国外流量
  - DOMAIN-SUFFIX,crackle.com,🔰国外流量
  - DOMAIN-SUFFIX,depositphotos.cn,🔰国外流量
  - DOMAIN-SUFFIX,dish.com,🔰国外流量
  - DOMAIN-SUFFIX,dmm.co.jp,🔰国外流量
  - DOMAIN-SUFFIX,dmm.com,🔰国外流量
  - DOMAIN-SUFFIX,dnvod.tv,🔰国外流量
  - DOMAIN-SUFFIX,esurance.com,🔰国外流量
  - DOMAIN-SUFFIX,extmatrix.com,🔰国外流量
  - DOMAIN-SUFFIX,fastpic.ru,🔰国外流量
  - DOMAIN-SUFFIX,flipboard.com,🔰国外流量
  - DOMAIN-SUFFIX,fnac.be,🔰国外流量
  - DOMAIN-SUFFIX,fnac.com,🔰国外流量
  - DOMAIN-SUFFIX,funkyimg.com,🔰国外流量
  - DOMAIN-SUFFIX,fxnetworks.com,🔰国外流量
  - DOMAIN-SUFFIX,gettyimages.com,🔰国外流量
  - DOMAIN-SUFFIX,go.com,🔰国外流量
  - DOMAIN-SUFFIX,here.com,🔰国外流量
  - DOMAIN-SUFFIX,jcpenney.com,🔰国外流量
  - DOMAIN-SUFFIX,jiehua.tv,🔰国外流量
  - DOMAIN-SUFFIX,mailfence.com,🔰国外流量
  - DOMAIN-SUFFIX,nationwide.com,🔰国外流量
  - DOMAIN-SUFFIX,nbc.com,🔰国外流量
  - DOMAIN-SUFFIX,nexon.com,🔰国外流量
  - DOMAIN-SUFFIX,nordstrom.com,🔰国外流量
  - DOMAIN-SUFFIX,nordstromimage.com,🔰国外流量
  - DOMAIN-SUFFIX,nordstromrack.com,🔰国外流量
  - DOMAIN-SUFFIX,superpages.com,🔰国外流量
  - DOMAIN-SUFFIX,target.com,🔰国外流量
  - DOMAIN-SUFFIX,thinkgeek.com,🔰国外流量
  - DOMAIN-SUFFIX,tracfone.com,🔰国外流量
  - DOMAIN-SUFFIX,unity3d.com,🔰国外流量
  - DOMAIN-SUFFIX,uploader.jp,🔰国外流量
  - DOMAIN-SUFFIX,vevo.com,🔰国外流量
  - DOMAIN-SUFFIX,viu.tv,🔰国外流量
  - DOMAIN-SUFFIX,vk.com,🔰国外流量
  - DOMAIN-SUFFIX,vsco.co,🔰国外流量
  - DOMAIN-SUFFIX,xfinity.com,🔰国外流量
  - DOMAIN-SUFFIX,zattoo.com,🔰国外流量
  - DOMAIN,testflight.apple.com,🔰国外流量
  - DOMAIN-SUFFIX,appsto.re,🔰国外流量
  - DOMAIN,books.itunes.apple.com,🔰国外流量
  - DOMAIN,hls.itunes.apple.com,🔰国外流量
  - DOMAIN,apps.apple.com,🔰国外流量
  - DOMAIN,itunes.apple.com,🔰国外流量
  - DOMAIN,api-glb-sea.smoot.apple.com,🔰国外流量
  - DOMAIN,lookup-api.apple.com,🔰国外流量
  - DOMAIN-SUFFIX,abc.xyz,🔰国外流量
  - DOMAIN-SUFFIX,android.com,🔰国外流量
  - DOMAIN-SUFFIX,androidify.com,🔰国外流量
  - DOMAIN-SUFFIX,dialogflow.com,🔰国外流量
  - DOMAIN-SUFFIX,autodraw.com,🔰国外流量
  - DOMAIN-SUFFIX,capitalg.com,🔰国外流量
  - DOMAIN-SUFFIX,certificate-transparency.org,🔰国外流量
  - DOMAIN-SUFFIX,chrome.com,🔰国外流量
  - DOMAIN-SUFFIX,chromeexperiments.com,🔰国外流量
  - DOMAIN-SUFFIX,chromestatus.com,🔰国外流量
  - DOMAIN-SUFFIX,chromium.org,🔰国外流量
  - DOMAIN-SUFFIX,creativelab5.com,🔰国外流量
  - DOMAIN-SUFFIX,debug.com,🔰国外流量
  - DOMAIN-SUFFIX,deepmind.com,🔰国外流量
  - DOMAIN-SUFFIX,firebaseio.com,🔰国外流量
  - DOMAIN-SUFFIX,getmdl.io,🔰国外流量
  - DOMAIN-SUFFIX,ggpht.com,🔰国外流量
  - DOMAIN-SUFFIX,gmail.com,🔰国外流量
  - DOMAIN-SUFFIX,gmodules.com,🔰国外流量
  - DOMAIN-SUFFIX,godoc.org,🔰国外流量
  - DOMAIN-SUFFIX,golang.org,🔰国外流量
  - DOMAIN-SUFFIX,gstatic.com,🔰国外流量
  - DOMAIN-SUFFIX,gv.com,🔰国外流量
  - DOMAIN-SUFFIX,gwtproject.org,🔰国外流量
  - DOMAIN-SUFFIX,itasoftware.com,🔰国外流量
  - DOMAIN-SUFFIX,madewithcode.com,🔰国外流量
  - DOMAIN-SUFFIX,material.io,🔰国外流量
  - DOMAIN-SUFFIX,polymer-project.org,🔰国外流量
  - DOMAIN-SUFFIX,admin.recaptcha.net,🔰国外流量
  - DOMAIN-SUFFIX,recaptcha.net,🔰国外流量
  - DOMAIN-SUFFIX,shattered.io,🔰国外流量
  - DOMAIN-SUFFIX,synergyse.com,🔰国外流量
  - DOMAIN-SUFFIX,tensorflow.org,🔰国外流量
  - DOMAIN-SUFFIX,tfhub.dev,🔰国外流量
  - DOMAIN-SUFFIX,tiltbrush.com,🔰国外流量
  - DOMAIN-SUFFIX,waveprotocol.org,🔰国外流量
  - DOMAIN-SUFFIX,waymo.com,🔰国外流量
  - DOMAIN-SUFFIX,webmproject.org,🔰国外流量
  - DOMAIN-SUFFIX,webrtc.org,🔰国外流量
  - DOMAIN-SUFFIX,whatbrowser.org,🔰国外流量
  - DOMAIN-SUFFIX,widevine.com,🔰国外流量
  - DOMAIN-SUFFIX,x.company,🔰国外流量
  - DOMAIN-SUFFIX,youtu.be,🔰国外流量
  - DOMAIN-SUFFIX,yt.be,🔰国外流量
  - DOMAIN-SUFFIX,ytimg.com,🔰国外流量
  - DOMAIN-SUFFIX,1drv.com,🔰国外流量
  - DOMAIN-SUFFIX,1drv.ms,🔰国外流量
  - DOMAIN-SUFFIX,blob.core.windows.net,🔰国外流量
  - DOMAIN-SUFFIX,livefilestore.com,🔰国外流量
  - DOMAIN-SUFFIX,onedrive.com,🔰国外流量
  - DOMAIN-SUFFIX,storage.live.com,🔰国外流量
  - DOMAIN-SUFFIX,storage.msn.com,🔰国外流量
  - DOMAIN,oneclient.sfx.ms,🔰国外流量
  - DOMAIN-SUFFIX,0rz.tw,🔰国外流量
  - DOMAIN-SUFFIX,4bluestones.biz,🔰国外流量
  - DOMAIN-SUFFIX,9bis.net,🔰国外流量
  - DOMAIN-SUFFIX,allconnected.co,🔰国外流量
  - DOMAIN-SUFFIX,aol.com,🔰国外流量
  - DOMAIN-SUFFIX,bcc.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,bit.ly,🔰国外流量
  - DOMAIN-SUFFIX,bitshare.com,🔰国外流量
  - DOMAIN-SUFFIX,blog.jp,🔰国外流量
  - DOMAIN-SUFFIX,blogimg.jp,🔰国外流量
  - DOMAIN-SUFFIX,blogtd.org,🔰国外流量
  - DOMAIN-SUFFIX,broadcast.co.nz,🔰国外流量
  - DOMAIN-SUFFIX,camfrog.com,🔰国外流量
  - DOMAIN-SUFFIX,cfos.de,🔰国外流量
  - DOMAIN-SUFFIX,citypopulation.de,🔰国外流量
  - DOMAIN-SUFFIX,cloudfront.net,🔰国外流量
  - DOMAIN-SUFFIX,ctitv.com.tw,🔰国外流量
  - DOMAIN-SUFFIX,cuhk.edu.hk,🔰国外流量
  - DOMAIN-SUFFIX,cusu.hk,🔰国外流量
  - DOMAIN-SUFFIX,discord.gg,🔰国外流量
  - DOMAIN-SUFFIX,discuss.com.hk,🔰国外流量
  - DOMAIN-SUFFIX,dropboxapi.com,🔰国外流量
  - DOMAIN-SUFFIX,duolingo.cn,🔰国外流量
  - DOMAIN-SUFFIX,edditstatic.com,🔰国外流量
  - DOMAIN-SUFFIX,flickriver.com,🔰国外流量
  - DOMAIN-SUFFIX,focustaiwan.tw,🔰国外流量
  - DOMAIN-SUFFIX,free.fr,🔰国外流量
  - DOMAIN-SUFFIX,gigacircle.com,🔰国外流量
  - DOMAIN-SUFFIX,hk-pub.com,🔰国外流量
  - DOMAIN-SUFFIX,hosting.co.uk,🔰国外流量
  - DOMAIN-SUFFIX,hwcdn.net,🔰国外流量
  - DOMAIN-SUFFIX,ifixit.com,🔰国外流量
  - DOMAIN-SUFFIX,iphone4hongkong.com,🔰国外流量
  - DOMAIN-SUFFIX,iphonetaiwan.org,🔰国外流量
  - DOMAIN-SUFFIX,iptvbin.com,🔰国外流量
  - DOMAIN-SUFFIX,linksalpha.com,🔰国外流量
  - DOMAIN-SUFFIX,manyvids.com,🔰国外流量
  - DOMAIN-SUFFIX,myactimes.com,🔰国外流量
  - DOMAIN-SUFFIX,newsblur.com,🔰国外流量
  - DOMAIN-SUFFIX,now.im,🔰国外流量
  - DOMAIN-SUFFIX,nowe.com,🔰国外流量
  - DOMAIN-SUFFIX,redditlist.com,🔰国外流量
  - DOMAIN-SUFFIX,s3.amazonaws.com,🔰国外流量
  - DOMAIN-SUFFIX,signal.org,🔰国外流量
  - DOMAIN-SUFFIX,smartmailcloud.com,🔰国外流量
  - DOMAIN-SUFFIX,sparknotes.com,🔰国外流量
  - DOMAIN-SUFFIX,streetvoice.com,🔰国外流量
  - DOMAIN-SUFFIX,supertop.co,🔰国外流量
  - DOMAIN-SUFFIX,tv.com,🔰国外流量
  - DOMAIN-SUFFIX,typepad.com,🔰国外流量
  - DOMAIN-SUFFIX,udnbkk.com,🔰国外流量
  - DOMAIN-SUFFIX,urbanairship.com,🔰国外流量
  - DOMAIN-SUFFIX,whispersystems.org,🔰国外流量
  - DOMAIN-SUFFIX,wikia.com,🔰国外流量
  - DOMAIN-SUFFIX,wn.com,🔰国外流量
  - DOMAIN-SUFFIX,wolframalpha.com,🔰国外流量
  - DOMAIN-SUFFIX,x-art.com,🔰国外流量
  - DOMAIN-SUFFIX,yimg.com,🔰国外流量
  - DOMAIN-SUFFIX,anthropic.com,🔰国外流量
  - DOMAIN-SUFFIX,claude.ai,🔰国外流量
  - DOMAIN-SUFFIX,temu.com,🔰国外流量
  - DOMAIN,api.steampowered.com,🔰国外流量
  - DOMAIN,store.steampowered.com,🔰国外流量
  - DOMAIN,cdn.usefathom.com,🔰国外流量
  - DOMAIN-SUFFIX,sciencedirect.com,🔰国外流量
  - DOMAIN-SUFFIX,sciencemag.org,🔰国外流量
  - DOMAIN-SUFFIX,scopus.com,🔰国外流量
  - DOMAIN-SUFFIX,monica.im,🔰国外流量

  - DOMAIN-SUFFIX,local,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
  - IP-CIDR,10.0.0.0/8,DIRECT,no-resolve
  - IP-CIDR,172.16.0.0/12,DIRECT,no-resolve
  - IP-CIDR,127.0.0.0/8,DIRECT,no-resolve
  - IP-CIDR,100.64.0.0/10,DIRECT,no-resolve
  - IP-CIDR6,::1/128,DIRECT,no-resolve
  - IP-CIDR6,fc00::/7,DIRECT,no-resolve
  - IP-CIDR6,fe80::/10,DIRECT,no-resolve
  - IP-CIDR6,fd00::/8,DIRECT,no-resolve
  - DOMAIN,app.adjust.com,DIRECT
  - DOMAIN,hho-inc.com,DIRECT
  - DOMAIN-SUFFIX,googletraveladservices.com,DIRECT
  - DOMAIN,dl.google.com,DIRECT
  - DOMAIN,mtalk.google.com,DIRECT
  - DOMAIN,livew.l.qq.com,DIRECT
  - DOMAIN,vd.l.qq.com,DIRECT
  - DOMAIN,analytics.strava.com,DIRECT
  - DOMAIN,msg.umeng.com,DIRECT
  - DOMAIN,msg.umengcloud.com,DIRECT
  - DOMAIN-SUFFIX,qhres.com,DIRECT
  - DOMAIN-SUFFIX,qhimg.com,DIRECT
  - DOMAIN-SUFFIX,akadns.net,DIRECT
  - DOMAIN-SUFFIX,alibaba.com,DIRECT
  - DOMAIN-SUFFIX,alicdn.com,DIRECT
  - DOMAIN-SUFFIX,alikunlun.com,DIRECT
  - DOMAIN-SUFFIX,alipay.com,DIRECT
  - DOMAIN-SUFFIX,amap.com,DIRECT
  - DOMAIN-SUFFIX,autonavi.com,DIRECT
  - DOMAIN-SUFFIX,dingtalk.com,DIRECT
  - DOMAIN-SUFFIX,mxhichina.com,DIRECT
  - DOMAIN-SUFFIX,soku.com,DIRECT
  - DOMAIN-SUFFIX,taobao.com,DIRECT
  - DOMAIN-SUFFIX,tmall.com,DIRECT
  - DOMAIN-SUFFIX,tmall.hk,DIRECT
  - DOMAIN-SUFFIX,ykimg.com,DIRECT
  - DOMAIN-SUFFIX,youku.com,DIRECT
  - DOMAIN-SUFFIX,xiami.com,DIRECT
  - DOMAIN-SUFFIX,xiami.net,DIRECT
  - DOMAIN-SUFFIX,aaplimg.com,DIRECT
  - DOMAIN-SUFFIX,apple.co,DIRECT
  - DOMAIN-SUFFIX,apple.com,DIRECT
  - DOMAIN-SUFFIX,apple-cloudkit.com,DIRECT
  - DOMAIN-SUFFIX,appstore.com,DIRECT
  - DOMAIN-SUFFIX,cdn-apple.com,DIRECT
  - DOMAIN-SUFFIX,crashlytics.com,DIRECT
  - DOMAIN-SUFFIX,icloud.com,DIRECT
  - DOMAIN-SUFFIX,icloud-content.com,DIRECT
  - DOMAIN-SUFFIX,me.com,DIRECT
  - DOMAIN-SUFFIX,mzstatic.com,DIRECT
  - DOMAIN,www-cdn.icloud.com.akadns.net,DIRECT
  - DOMAIN-SUFFIX,baidu.com,DIRECT
  - DOMAIN-SUFFIX,baidubcr.com,DIRECT
  - DOMAIN-SUFFIX,bdstatic.com,DIRECT
  - DOMAIN-SUFFIX,yunjiasu-cdn.net,DIRECT
  - DOMAIN-SUFFIX,acgvideo.com,DIRECT
  - DOMAIN-SUFFIX,hdslb.com,DIRECT
  - DOMAIN-SUFFIX,blizzard.com,DIRECT
  - DOMAIN-SUFFIX,battle.net,DIRECT
  - DOMAIN,blzddist1-a.akamaihd.net,DIRECT
  - DOMAIN-SUFFIX,feiliao.com,DIRECT
  - DOMAIN-SUFFIX,pstatp.com,DIRECT
  - DOMAIN-SUFFIX,snssdk.com,DIRECT
  - DOMAIN-SUFFIX,iesdouyin.com,DIRECT
  - DOMAIN-SUFFIX,toutiao.com,DIRECT
  - DOMAIN-SUFFIX,cctv.com,DIRECT
  - DOMAIN-SUFFIX,cctvpic.com,DIRECT
  - DOMAIN-SUFFIX,livechina.com,DIRECT
  - DOMAIN-SUFFIX,didialift.com,DIRECT
  - DOMAIN-SUFFIX,didiglobal.com,DIRECT
  - DOMAIN-SUFFIX,udache.com,DIRECT
  - DOMAIN-SUFFIX,343480.com,DIRECT
  - DOMAIN-SUFFIX,baduziyuan.com,DIRECT
  - DOMAIN-SUFFIX,com-hs-hkdy.com,DIRECT
  - DOMAIN-SUFFIX,czybjz.com,DIRECT
  - DOMAIN-SUFFIX,dandanzan.com,DIRECT
  - DOMAIN-SUFFIX,fjhps.com,DIRECT
  - DOMAIN-SUFFIX,kuyunbo.club,DIRECT
  - DOMAIN-SUFFIX,21cn.com,DIRECT
  - DOMAIN-SUFFIX,hitv.com,DIRECT
  - DOMAIN-SUFFIX,mgtv.com,DIRECT
  - DOMAIN-SUFFIX,iqiyi.com,DIRECT
  - DOMAIN-SUFFIX,iqiyipic.com,DIRECT
  - DOMAIN-SUFFIX,71.am.com,DIRECT
  - DOMAIN-SUFFIX,jd.com,DIRECT
  - DOMAIN-SUFFIX,jd.hk,DIRECT
  - DOMAIN-SUFFIX,jdpay.com,DIRECT
  - DOMAIN-SUFFIX,360buyimg.com,DIRECT
  - DOMAIN-SUFFIX,iciba.com,DIRECT
  - DOMAIN-SUFFIX,ksosoft.com,DIRECT
  - DOMAIN-SUFFIX,meitu.com,DIRECT
  - DOMAIN-SUFFIX,meitudata.com,DIRECT
  - DOMAIN-SUFFIX,meitustat.com,DIRECT
  - DOMAIN-SUFFIX,meipai.com,DIRECT
  - DOMAIN-SUFFIX,duokan.com,DIRECT
  - DOMAIN-SUFFIX,mi-img.com,DIRECT
  - DOMAIN-SUFFIX,miui.com,DIRECT
  - DOMAIN-SUFFIX,miwifi.com,DIRECT
  - DOMAIN-SUFFIX,xiaomi.com,DIRECT
  - DOMAIN-SUFFIX,microsoft.com,DIRECT
  - DOMAIN-SUFFIX,msecnd.net,DIRECT
  - DOMAIN-SUFFIX,office365.com,DIRECT
  - DOMAIN-SUFFIX,outlook.com,DIRECT
  - DOMAIN-SUFFIX,s-microsoft.com,DIRECT
  - DOMAIN-SUFFIX,visualstudio.com,DIRECT
  - DOMAIN-SUFFIX,windows.com,DIRECT
  - DOMAIN-SUFFIX,windowsupdate.com,DIRECT
  - DOMAIN,officecdn-microsoft-com.akamaized.net,DIRECT
  - DOMAIN-SUFFIX,163.com,DIRECT
  - DOMAIN-SUFFIX,126.net,DIRECT
  - DOMAIN-SUFFIX,127.net,DIRECT
  - DOMAIN-SUFFIX,163yun.com,DIRECT
  - DOMAIN-SUFFIX,lofter.com,DIRECT
  - DOMAIN-SUFFIX,netease.com,DIRECT
  - DOMAIN-SUFFIX,ydstatic.com,DIRECT
  - DOMAIN-SUFFIX,sina.com,DIRECT
  - DOMAIN-SUFFIX,weibo.com,DIRECT
  - DOMAIN-SUFFIX,weibocdn.com,DIRECT
  - DOMAIN-SUFFIX,sohu.com,DIRECT
  - DOMAIN-SUFFIX,sohucs.com,DIRECT
  - DOMAIN-SUFFIX,sohu-inc.com,DIRECT
  - DOMAIN-SUFFIX,v-56.com,DIRECT
  - DOMAIN-SUFFIX,sogo.com,DIRECT
  - DOMAIN-SUFFIX,sogou.com,DIRECT
  - DOMAIN-SUFFIX,sogoucdn.com,DIRECT
  - DOMAIN-SUFFIX,steampowered.com,DIRECT
  - DOMAIN-SUFFIX,steam-chat.com,DIRECT
  - DOMAIN-SUFFIX,steamgames.com,DIRECT
  - DOMAIN-SUFFIX,steamusercontent.com,DIRECT
  - DOMAIN-SUFFIX,steamcontent.com,DIRECT
  - DOMAIN-SUFFIX,steamstatic.com,DIRECT
  - DOMAIN-SUFFIX,steamcdn-a.akamaihd.net,DIRECT
  - DOMAIN-SUFFIX,steamstat.us,DIRECT
  - DOMAIN-SUFFIX,gtimg.com,DIRECT
  - DOMAIN-SUFFIX,idqqimg.com,DIRECT
  - DOMAIN-SUFFIX,igamecj.com,DIRECT
  - DOMAIN-SUFFIX,myapp.com,DIRECT
  - DOMAIN-SUFFIX,myqcloud.com,DIRECT
  - DOMAIN-SUFFIX,qq.com,DIRECT
  - DOMAIN-SUFFIX,tencent.com,DIRECT
  - DOMAIN-SUFFIX,tencent-cloud.net,DIRECT
  - DOMAIN-SUFFIX,jstucdn.com,DIRECT
  - DOMAIN-SUFFIX,zimuzu.io,DIRECT
  - DOMAIN-SUFFIX,zimuzu.tv,DIRECT
  - DOMAIN-SUFFIX,zmz2019.com,DIRECT
  - DOMAIN-SUFFIX,zmzapi.com,DIRECT
  - DOMAIN-SUFFIX,zmzapi.net,DIRECT
  - DOMAIN-SUFFIX,zmzfile.com,DIRECT
  - DOMAIN-SUFFIX,ccgslb.com,DIRECT
  - DOMAIN-SUFFIX,ccgslb.net,DIRECT
  - DOMAIN-SUFFIX,chinanetcenter.com,DIRECT
  - DOMAIN-SUFFIX,meixincdn.com,DIRECT
  - DOMAIN-SUFFIX,ourdvs.com,DIRECT
  - DOMAIN-SUFFIX,staticdn.net,DIRECT
  - DOMAIN-SUFFIX,wangsu.com,DIRECT
  - DOMAIN-SUFFIX,ipip.net,DIRECT
  - DOMAIN-SUFFIX,ip.la,DIRECT
  - DOMAIN-SUFFIX,ip-cdn.com,DIRECT
  - DOMAIN-SUFFIX,ipv6-test.com,DIRECT
  - DOMAIN-SUFFIX,test-ipv6.com,DIRECT
  - DOMAIN-SUFFIX,whatismyip.com,DIRECT
  - DOMAIN-SUFFIX,netspeedtestmaster.com,DIRECT
  - DOMAIN,speedtest.macpaw.com,DIRECT
  - DOMAIN-SUFFIX,awesome-hd.me,DIRECT
  - DOMAIN-SUFFIX,broadcasthe.net,DIRECT
  - DOMAIN-SUFFIX,chdbits.co,DIRECT
  - DOMAIN-SUFFIX,classix-unlimited.co.uk,DIRECT
  - DOMAIN-SUFFIX,empornium.me,DIRECT
  - DOMAIN-SUFFIX,gazellegames.net,DIRECT
  - DOMAIN-SUFFIX,hdchina.org,DIRECT
  - DOMAIN-SUFFIX,hdsky.me,DIRECT
  - DOMAIN-SUFFIX,icetorrent.org,DIRECT
  - DOMAIN-SUFFIX,jpopsuki.eu,DIRECT
  - DOMAIN-SUFFIX,keepfrds.com,DIRECT
  - DOMAIN-SUFFIX,madsrevolution.net,DIRECT
  - DOMAIN-SUFFIX,m-team.cc,DIRECT
  - DOMAIN-SUFFIX,nanyangpt.com,DIRECT
  - DOMAIN-SUFFIX,ncore.cc,DIRECT
  - DOMAIN-SUFFIX,open.cd,DIRECT
  - DOMAIN-SUFFIX,ourbits.club,DIRECT
  - DOMAIN-SUFFIX,passthepopcorn.me,DIRECT
  - DOMAIN-SUFFIX,privatehd.to,DIRECT
  - DOMAIN-SUFFIX,redacted.ch,DIRECT
  - DOMAIN-SUFFIX,springsunday.net,DIRECT
  - DOMAIN-SUFFIX,tjupt.org,DIRECT
  - DOMAIN-SUFFIX,totheglory.im,DIRECT
  - DOMAIN-SUFFIX,acm.org,DIRECT
  - DOMAIN-SUFFIX,acs.org,DIRECT
  - DOMAIN-SUFFIX,aip.org,DIRECT
  - DOMAIN-SUFFIX,ams.org,DIRECT
  - DOMAIN-SUFFIX,annualreviews.org,DIRECT
  - DOMAIN-SUFFIX,aps.org,DIRECT
  - DOMAIN-SUFFIX,ascelibrary.org,DIRECT
  - DOMAIN-SUFFIX,asm.org,DIRECT
  - DOMAIN-SUFFIX,asme.org,DIRECT
  - DOMAIN-SUFFIX,astm.org,DIRECT
  - DOMAIN-SUFFIX,bmj.com,DIRECT
  - DOMAIN-SUFFIX,cambridge.org,DIRECT
  - DOMAIN-SUFFIX,cas.org,DIRECT
  - DOMAIN-SUFFIX,clarivate.com,DIRECT
  - DOMAIN-SUFFIX,ebscohost.com,DIRECT
  - DOMAIN-SUFFIX,emerald.com,DIRECT
  - DOMAIN-SUFFIX,engineeringvillage.com,DIRECT
  - DOMAIN-SUFFIX,icevirtuallibrary.com,DIRECT
  - DOMAIN-SUFFIX,ieee.org,DIRECT
  - DOMAIN-SUFFIX,imf.org,DIRECT
  - DOMAIN-SUFFIX,iop.org,DIRECT
  - DOMAIN-SUFFIX,jamanetwork.com,DIRECT
  - DOMAIN-SUFFIX,jhu.edu,DIRECT
  - DOMAIN-SUFFIX,jstor.org,DIRECT
  - DOMAIN-SUFFIX,karger.com,DIRECT
  - DOMAIN-SUFFIX,libguides.com,DIRECT
  - DOMAIN-SUFFIX,madsrevolution.net,DIRECT
  - DOMAIN-SUFFIX,mpg.de,DIRECT
  - DOMAIN-SUFFIX,myilibrary.com,DIRECT
  - DOMAIN-SUFFIX,nature.com,DIRECT
  - DOMAIN-SUFFIX,oecd-ilibrary.org,DIRECT
  - DOMAIN-SUFFIX,osapublishing.org,DIRECT
  - DOMAIN-SUFFIX,oup.com,DIRECT
  - DOMAIN-SUFFIX,ovid.com,DIRECT
  - DOMAIN-SUFFIX,oxfordartonline.com,DIRECT
  - DOMAIN-SUFFIX,oxfordbibliographies.com,DIRECT
  - DOMAIN-SUFFIX,oxfordmusiconline.com,DIRECT
  - DOMAIN-SUFFIX,pnas.org,DIRECT
  - DOMAIN-SUFFIX,proquest.com,DIRECT
  - DOMAIN-SUFFIX,rsc.org,DIRECT
  - DOMAIN-SUFFIX,sagepub.com,DIRECT
  - DOMAIN-SUFFIX,siam.org,DIRECT
  - DOMAIN-SUFFIX,spiedigitallibrary.org,DIRECT
  - DOMAIN-SUFFIX,springer.com,DIRECT
  - DOMAIN-SUFFIX,springerlink.com,DIRECT
  - DOMAIN-SUFFIX,tandfonline.com,DIRECT
  - DOMAIN-SUFFIX,un.org,DIRECT
  - DOMAIN-SUFFIX,uni-bielefeld.de,DIRECT
  - DOMAIN-SUFFIX,webofknowledge.com,DIRECT
  - DOMAIN-SUFFIX,westlaw.com,DIRECT
  - DOMAIN-SUFFIX,wiley.com,DIRECT
  - DOMAIN-SUFFIX,worldbank.org,DIRECT
  - DOMAIN-SUFFIX,worldscientific.com,DIRECT
  - DOMAIN-SUFFIX,cn,DIRECT
  - DOMAIN-SUFFIX,360in.com,DIRECT
  - DOMAIN-SUFFIX,51ym.me,DIRECT
  - DOMAIN-SUFFIX,8686c.com,DIRECT
  - DOMAIN-SUFFIX,abchina.com,DIRECT
  - DOMAIN-SUFFIX,accuweather.com,DIRECT
  - DOMAIN-SUFFIX,aicoinstorge.com,DIRECT
  - DOMAIN-SUFFIX,air-matters.com,DIRECT
  - DOMAIN-SUFFIX,air-matters.io,DIRECT
  - DOMAIN-SUFFIX,aixifan.com,DIRECT
  - DOMAIN-SUFFIX,amd.com,DIRECT
  - DOMAIN-SUFFIX,b612.net,DIRECT
  - DOMAIN-SUFFIX,bdatu.com,DIRECT
  - DOMAIN-SUFFIX,beitaichufang.com,DIRECT
  - DOMAIN-SUFFIX,bjango.com,DIRECT
  - DOMAIN-SUFFIX,booking.com,DIRECT
  - DOMAIN-SUFFIX,bstatic.com,DIRECT
  - DOMAIN-SUFFIX,cailianpress.com,DIRECT
  - DOMAIN-SUFFIX,camera360.com,DIRECT
  - DOMAIN-SUFFIX,chinaso.com,DIRECT
  - DOMAIN-SUFFIX,chua.pro,DIRECT
  - DOMAIN-SUFFIX,chuimg.com,DIRECT
  - DOMAIN-SUFFIX,chunyu.mobi,DIRECT
  - DOMAIN-SUFFIX,chushou.tv,DIRECT
  - DOMAIN-SUFFIX,cmbchina.com,DIRECT
  - DOMAIN-SUFFIX,cmbimg.com,DIRECT
  - DOMAIN-SUFFIX,ctrip.com,DIRECT
  - DOMAIN-SUFFIX,dfcfw.com,DIRECT
  - DOMAIN-SUFFIX,docschina.org,DIRECT
  - DOMAIN-SUFFIX,douban.com,DIRECT
  - DOMAIN-SUFFIX,doubanio.com,DIRECT
  - DOMAIN-SUFFIX,douyu.com,DIRECT
  - DOMAIN-SUFFIX,dxycdn.com,DIRECT
  - DOMAIN-SUFFIX,dytt8.net,DIRECT
  - DOMAIN-SUFFIX,eastmoney.com,DIRECT
  - DOMAIN-SUFFIX,eudic.net,DIRECT
  - DOMAIN-SUFFIX,feng.com,DIRECT
  - DOMAIN-SUFFIX,fengkongcloud.com,DIRECT
  - DOMAIN-SUFFIX,frdic.com,DIRECT
  - DOMAIN-SUFFIX,futu5.com,DIRECT
  - DOMAIN-SUFFIX,futunn.com,DIRECT
  - DOMAIN-SUFFIX,gandi.net,DIRECT
  - DOMAIN-SUFFIX,geilicdn.com,DIRECT
  - DOMAIN-SUFFIX,getpricetag.com,DIRECT
  - DOMAIN-SUFFIX,gifshow.com,DIRECT
  - DOMAIN-SUFFIX,godic.net,DIRECT
  - DOMAIN-SUFFIX,hicloud.com,DIRECT
  - DOMAIN-SUFFIX,hongxiu.com,DIRECT
  - DOMAIN-SUFFIX,hostbuf.com,DIRECT
  - DOMAIN-SUFFIX,huxiucdn.com,DIRECT
  - DOMAIN-SUFFIX,huya.com,DIRECT
  - DOMAIN-SUFFIX,infinitynewtab.com,DIRECT
  - DOMAIN-SUFFIX,ithome.com,DIRECT
  - DOMAIN-SUFFIX,java.com,DIRECT
  - DOMAIN-SUFFIX,jidian.im,DIRECT
  - DOMAIN-SUFFIX,kaiyanapp.com,DIRECT
  - DOMAIN-SUFFIX,kaspersky-labs.com,DIRECT
  - DOMAIN-SUFFIX,keepcdn.com,DIRECT
  - DOMAIN-SUFFIX,kkmh.com,DIRECT
  - DOMAIN-SUFFIX,loli.net,DIRECT
  - DOMAIN-SUFFIX,luojilab.com,DIRECT
  - DOMAIN-SUFFIX,maoyan.com,DIRECT
  - DOMAIN-SUFFIX,maoyun.tv,DIRECT
  - DOMAIN-SUFFIX,meituan.com,DIRECT
  - DOMAIN-SUFFIX,meituan.net,DIRECT
  - DOMAIN-SUFFIX,mobike.com,DIRECT
  - DOMAIN-SUFFIX,moke.com,DIRECT
  - DOMAIN-SUFFIX,mubu.com,DIRECT
  - DOMAIN-SUFFIX,myzaker.com,DIRECT
  - DOMAIN-SUFFIX,nim-lang-cn.org,DIRECT
  - DOMAIN-SUFFIX,nvidia.com,DIRECT
  - DOMAIN-SUFFIX,oracle.com,DIRECT
  - DOMAIN-SUFFIX,paypal.com,DIRECT
  - DOMAIN-SUFFIX,paypalobjects.com,DIRECT
  - DOMAIN-SUFFIX,qdaily.com,DIRECT
  - DOMAIN-SUFFIX,qidian.com,DIRECT
  - DOMAIN-SUFFIX,qyer.com,DIRECT
  - DOMAIN-SUFFIX,qyerstatic.com,DIRECT
  - DOMAIN-SUFFIX,raychase.net,DIRECT
  - DOMAIN-SUFFIX,ronghub.com,DIRECT
  - DOMAIN-SUFFIX,ruguoapp.com,DIRECT
  - DOMAIN-SUFFIX,s-reader.com,DIRECT
  - DOMAIN-SUFFIX,sankuai.com,DIRECT
  - DOMAIN-SUFFIX,scomper.me,DIRECT
  - DOMAIN-SUFFIX,seafile.com,DIRECT
  - DOMAIN-SUFFIX,sm.ms,DIRECT
  - DOMAIN-SUFFIX,smzdm.com,DIRECT
  - DOMAIN-SUFFIX,snapdrop.net,DIRECT
  - DOMAIN-SUFFIX,snwx.com,DIRECT
  - DOMAIN-SUFFIX,sspai.com,DIRECT
  - DOMAIN-SUFFIX,takungpao.com,DIRECT
  - DOMAIN-SUFFIX,teamviewer.com,DIRECT
  - DOMAIN-SUFFIX,tianyancha.com,DIRECT
  - DOMAIN-SUFFIX,udacity.com,DIRECT
  - DOMAIN-SUFFIX,uning.com,DIRECT
  - DOMAIN-SUFFIX,vmware.com,DIRECT
  - DOMAIN-SUFFIX,weather.com,DIRECT
  - DOMAIN-SUFFIX,weico.cc,DIRECT
  - DOMAIN-SUFFIX,weidian.com,DIRECT
  - DOMAIN-SUFFIX,xiachufang.com,DIRECT
  - DOMAIN-SUFFIX,ximalaya.com,DIRECT
  - DOMAIN-SUFFIX,xinhuanet.com,DIRECT
  - DOMAIN-SUFFIX,xmcdn.com,DIRECT
  - DOMAIN-SUFFIX,yangkeduo.com,DIRECT
  - DOMAIN-SUFFIX,zhangzishi.cc,DIRECT
  - DOMAIN-SUFFIX,zhihu.com,DIRECT
  - DOMAIN-SUFFIX,zhimg.com,DIRECT
  - DOMAIN-SUFFIX,zhuihd.com,DIRECT
  - DOMAIN-SUFFIX,coincall.com,DIRECT
  - DOMAIN-SUFFIX,adobe.io,DIRECT
  - DOMAIN-SUFFIX,ddurl.to,DIRECT
  - DOMAIN-SUFFIX,dg-work.cn,DIRECT
  - DOMAIN-SUFFIX,dingding.xin,DIRECT
  - DOMAIN-SUFFIX,dingtalk.cn,DIRECT
  - DOMAIN-SUFFIX,dingtalk.com,DIRECT
  - DOMAIN-SUFFIX,dingtalk.com.cn,DIRECT
  - DOMAIN-SUFFIX,dingtalk.net,DIRECT
  - DOMAIN-SUFFIX,dingtalkapps.com,DIRECT
  - DOMAIN-SUFFIX,laiwang.com,DIRECT
  - DOMAIN-SUFFIX,lwurl.to,DIRECT
  - DOMAIN-SUFFIX,realapp.xin,DIRECT
  - DOMAIN,download.jetbrains.com,DIRECT
  - DOMAIN,images-cn.ssl-images-amazon.com,DIRECT
  - IP-CIDR,119.28.28.28/32,DIRECT,no-resolve
  - GEOIP,CN,DIRECT

  - MATCH,⚓️其他流量
`, proxy1.Protocol, proxy1.Host, proxy1.Port, proxy1.UserName, proxy1.Password)

	return res, nil
}

func GetProxyList(userId string, filter map[string]interface{}, page int, pageSize int) ([]ProxyWithUserHashId, int, error) {
	var proxyList []ProxyWithUserHashId
	db, err := composite.Database.GetOrm()
	if err != nil {
		return proxyList, 0, err
	}
	proxyModel := proxy2.Proxy{
		UserId: userId,
	}
	list, total, err := proxyModel.GetListByUserIdPaginate(db, filter, page, pageSize)
	instanceModel := resources.InstanceUses{
		UserId: userId,
	}
	for _, proxy1 := range list {
		proxyWithUserHashId := ProxyWithUserHashId{
			Proxy: proxy1,
		}
		hd := hashids.NewData()
		hd.Salt = HashIdsSalt // 盐值决定编码结果
		hd.MinLength = 8      // 最短长度
		h, err := hashids.NewWithData(hd)
		if err != nil {
			fmt.Println(err)
		}
		// 编码
		encoded, err := h.EncodeInt64([]int64{int64(proxy1.Id)})
		if err != nil {
			fmt.Println(err)
			return proxyList, total, err
		}
		proxyWithUserHashId.HashId = encoded
		if err != nil {
			return proxyList, total, err
		}
		list2, err := instanceModel.GetBindProxyInstanceListByUserId(db, proxy1.Id)
		if err != nil {
			fmt.Println(err)
		}
		proxyWithUserHashId.BindInstanceList = list2
		proxyWithUserHashId.BindNum = len(list2)
		proxyList = append(proxyList, proxyWithUserHashId)
	}
	return proxyList, total, nil
}

type BindInstanceRequest struct {
	ProxyId    int     `json:"proxy_id"`
	InstanceId []int64 `json:"instance_id"`
}

func BindInstance(userId string, proxy_id int, instance_id []int64) error {
	proxyModel := proxy2.Proxy{Id: proxy_id}
	//InstanceModel := resources.InstanceUses{Id: instance_id}
	db, err := composite.Database.GetOrm()
	if err != nil {
		return err
	}
	err = proxyModel.GetById(db)
	if err != nil {
		return err
	}
	for _, InstanceId := range instance_id {
		InstanceModel := resources.InstanceUses{Id: InstanceId}
		err = InstanceModel.GetByIdWithInstanceInfo(db)
		if err != nil {
			return err
		}
		if InstanceModel.UserId != userId {
			return fmt.Errorf("实例不属于当前用户")
		}
		if proxyModel.UserId != userId {
			return fmt.Errorf("代理不属于当前用户")
		}
		InstanceModel.ProxyId = proxy_id
		err = InstanceModel.UpdatePartFields(db, map[string]interface{}{"proxy_id": proxy_id})
		if err != nil {
			return err
		}
		go func(instanceId int64) {
			//err := ProcessClash(instanceId)
			err := realphone.ChangeRealPhoneModel(InstanceModel.Id, InstanceModel.Instances.AdiTemplateId, userId)
			if err != nil {
				fmt.Println(err)
			}
		}(InstanceId)
	}

	return nil
}

func UnbindInstances(userId string, proxy_id int, instance_id []int64) error {
	proxyModel := proxy2.Proxy{Id: proxy_id}
	db, err := composite.Database.GetOrm()
	if err != nil {
		return err

	}
	err = proxyModel.GetById(db)
	if err != nil {
		return err
	}
	for _, InstanceId := range instance_id {
		InstanceModel := resources.InstanceUses{Id: InstanceId}
		err = InstanceModel.GetByIdWithInstanceInfo(db)
		if err != nil {
			return err
		}
		if InstanceModel.UserId != userId {
			return fmt.Errorf("实例不属于当前用户")
		}
		if proxyModel.Id != InstanceModel.ProxyId {
			continue
		}
		InstanceModel.ProxyId = 0
		err = InstanceModel.UpdatePartFields(db, map[string]interface{}{"proxy_id": 0})
		go func(instanceId int64) {
			//err := ProcessClash(instanceId)
			err := realphone.ChangeRealPhoneModel(InstanceModel.Id, InstanceModel.Instances.AdiTemplateId, userId)
			if err != nil {
				fmt.Println(err)
			}
		}(InstanceId)
	}
	return nil
}

type UpdateProxyRequest struct {
	CreateProxyRequest
	Id int `json:"id"`
}

func UpdateProxy(userId string, req UpdateProxyRequest) (*ProxyWithUserHashId, error) {
	proxy1 := proxy2.Proxy{Id: req.Id}
	var res ProxyWithUserHashId
	db, err := composite.Database.GetOrm()
	if err != nil {
		return &res, err
	}
	err = proxy1.GetById(db)
	if err != nil {
		return &res, err
	}
	if proxy1.UserId != userId {
		return &res, fmt.Errorf("代理不属于当前用户")
	}

	proxy1.Id = req.Id
	proxy1.ProxyName = req.Name
	proxy1.Protocol = req.Protocol
	proxy1.Host = req.Host
	proxy1.Port = req.Port
	proxy1.UserName = req.Username
	proxy1.Password = req.Password
	proxy1.Type = "static"
	proxy1.Remark = req.Remark

	proxyInfoRet := &ProxyWithUserHashId{
		Proxy: &proxy1,
	}
	var (
		ipInfo IpifyResponse
	)
	hostPort := req.Host + ":" + fmt.Sprintf("%d", req.Port)
	//获取IP所属国家
	if proxy1.Protocol == "http" || proxy1.Protocol == "https" {
		ipInfo, err = getOutboundIPViaHTTPProxy(proxy1.Protocol+"://"+hostPort, req.Username, req.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return proxyInfoRet, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	} else if proxy1.Protocol == "socks5" {
		ipInfo, err = getOutboundIPViaSocks5(hostPort, req.Username, req.Password, "http://ip-api.com/json/")
		if err != nil {
			fmt.Println("Error:", err)
			return proxyInfoRet, fmt.Errorf("Failed to get IP information")
		} else {
			fmt.Println("Your public IP address:", ipInfo)
		}
	}
	proxy1.ExternalIp = ipInfo.Query
	proxy1.Country = ipInfo.Country
	proxy1.RegionCode = ipInfo.Region
	proxy1.City = ipInfo.City
	proxy1.CountryCode = ipInfo.CountryCode
	proxy1.Status = 1
	proxy1.Timezone = ipInfo.Timezone

	proxy1.Lat = fmt.Sprintf("%f", ipInfo.Lat)
	proxy1.Lon = fmt.Sprintf("%f", ipInfo.Lon)

	err = proxy1.Update(db)
	if err != nil {
		fmt.Println("Error:", err)
		return proxyInfoRet, err
	}
	hd := hashids.NewData()
	hd.Salt = HashIdsSalt // 盐值决定编码结果
	hd.MinLength = 8      // 最短长度
	h, err := hashids.NewWithData(hd)
	if err != nil {
		fmt.Println(err)
	}
	// 编码
	encoded, err := h.EncodeInt64([]int64{int64(proxy1.Id)})
	if err != nil {
		fmt.Println(err)
	}
	proxyInfoRet.HashId = encoded
	return proxyInfoRet, nil
}

type DeleteProxyRequest struct {
	Ids []int `json:"ids"`
}

func DeleteProxy(userId string, ids []int) error {
	db, err := composite.Database.GetOrm()
	if err != nil {
		fmt.Printf("Error getting database: %v", err)
		return err
	}
	err = db.Transaction(func(tx *gorm.DB) error {
		for _, id := range ids {
			proxy1 := proxy2.Proxy{Id: id}
			err = proxy1.GetById(db)
			if err != nil {
				fmt.Printf("Error getting proxy: %v", err)
				return err
			}
			if proxy1.UserId != userId {
				return fmt.Errorf("代理不属于当前用户")
			}
			instanceModel := resources.InstanceUses{ProxyId: proxy1.Id, UserId: userId}
			list, err := instanceModel.GetBindProxyInstanceListByUserId(tx, proxy1.Id)
			if err != nil {
				fmt.Printf("Error getting instance: %v", err)
				if !gorm.IsRecordNotFoundError(err) {
					return err
				}
			}
			if len(list) > 0 {
				return fmt.Errorf("该代理绑定有云机，请先解绑云机后再试")
			}
			err = proxy1.Delete(tx)
			if err != nil {
				return err
			}
		}
		return nil
	})
	return err

}
func GetProxyRelatedInstances(userId string, proxyId int) ([]resources.InstanceUses, error) {
	db, err := composite.Database.GetOrm()
	if err != nil {
		return []resources.InstanceUses{}, err
	}
	instanceModel := resources.InstanceUses{UserId: userId}
	instancelist, err := instanceModel.GetBindProxyInstanceListByUserId(db, proxyId)
	return instancelist, err
}
